// 弹窗的reducer
import { ACTIVATE } from "../constants";
import { fromJS } from "immutable";

const initState = {
    
    popup:{
        activate: false,
        btn_left: '',
        btn_right:'',
        content: ''
    }
}


export default function PopupReducer(preState=initState, action) {
    const {type, data} = action
    switch (type) {
        case ACTIVATE:
            return {
                ...preState,
                popup:Object.assign({}, preState.popup, data)
            }
            
        default:
            // return {...prepState} // 会导致数据持久化失效
            var state = preState
            return state
    }
}
